{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c4f6aa62",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from numpy import sin, cos, pi\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.patches as mpatch\n",
    "from matplotlib.patches import Arc, Circle, Wedge\n",
    "from matplotlib.collections import PatchCollection\n",
    "from matplotlib.font_manager import FontProperties"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "40eb9d15",
   "metadata": {},
   "outputs": [],
   "source": [
    "# !wget http://tianchi-media.oss-cn-beijing.aliyuncs.com/DSW/Python/miniproject/01_draw_moon_cake/Alibaba-PuHuiTi-Medium.ttf\n",
    "length = 20  \n",
    "R = 3**0.5*length/(3**0.5*cos(pi/12)-sin(pi/12))\n",
    "r = 2*sin(pi/12)*R/3**0.5\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "cefb6714",
   "metadata": {},
   "outputs": [],
   "source": [
    "arc1 = Arc([0, length], width=2*r, height=2*r, \n",
    "           angle=0, theta1=30, theta2=150, ec='orange', linewidth=4)  ##ec为线条颜色，可以自由替换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "9eada97e",
   "metadata": {},
   "outputs": [],
   "source": [
    "#arc1 = Arc([0, length], width=2*r, height=2*r, angle=0, theta1=30, theta2=150, ec='orange', linewidth=4)\n",
    "arc2 = Arc([-length/2, length/2*3**0.5], width=2*r, height=2*r, \n",
    "           angle=0, theta1=60, theta2=180, ec='orange', linewidth=4)\n",
    "arc3 = Arc([-length/2*3**0.5, length/2], width=2*r, height=2*r, \n",
    "           angle=0, theta1=90, theta2=210, ec='orange', linewidth=4)\n",
    "arc4 = Arc([-length, 0], width=2*r, height=2*r, angle=0, theta1=120, theta2=240, ec='orange', linewidth=4)\n",
    "arc5 = Arc([-length/2*3**0.5, -length/2], width=2*r, height=2*r, \n",
    "           angle=0, theta1=150, theta2=270, ec='orange', linewidth=4)\n",
    "arc6 = Arc([-length/2, -length/2*3**0.5], width=2*r, height=2*r,\n",
    "           angle=0, theta1=180, theta2=300, ec='orange', linewidth=4)\n",
    "arc7 = Arc([0, -length], width=2*r, height=2*r, angle=0, theta1=210, theta2=330, ec='orange', linewidth=4)\n",
    "arc8 = Arc([length/2, -length/2*3**0.5], width=2*r, height=2*r,\n",
    "           angle=0, theta1=240, theta2=360, ec='orange', linewidth=4)\n",
    "arc9 = Arc([length/2*3**0.5, -length/2], width=2*r, height=2*r,\n",
    "           angle=0, theta1=270, theta2=390, ec='orange', linewidth=4)\n",
    "arc10 = Arc([length, 0], width=2*r, height=2*r, angle=0, theta1=300, theta2=420, ec='orange', linewidth=4)\n",
    "arc11 = Arc([length/2*3**0.5, length/2], width=2*r, height=2*r,\n",
    "            angle=0, theta1=330, theta2=450, ec='orange', linewidth=4)\n",
    "arc12 = Arc([length/2, length/2*3**0.5], width=2*r, height=2*r,\n",
    "            angle=0, theta1=0, theta2=120, ec='orange', linewidth=4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "b0abe33e",
   "metadata": {},
   "outputs": [],
   "source": [
    "circle = Circle((0,0), R, ec='orange', fc='white', linewidth=4) ##ec为线条颜色，fc为填充颜色,可以自由替换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "84d1dabd",
   "metadata": {},
   "outputs": [],
   "source": [
    "wedge1 = Wedge([-2, 2], R-5, 90, 180,\n",
    "               ec='orange', fc=r'white', linewidth=4) ##ec为线条颜色，fc为填充颜色,可以自由替换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "94f3cffd",
   "metadata": {},
   "outputs": [],
   "source": [
    "wedge2 = Wedge([-5, 5], R-12, 90, 180, ec='orange',\n",
    "               fc=r'white', linewidth=4)\n",
    "wedge3 = Wedge([-2, -2], R-5, 180, 270, ec='orange', \n",
    "               fc=r'white', linewidth=4)\n",
    "wedge4 = Wedge([-5, -5], R-12, 180, 270, ec='orange', \n",
    "               fc=r'white', linewidth=4)\n",
    "wedge5 = Wedge([2, -2], R-5, 270, 360, ec='orange', \n",
    "               fc=r'white', linewidth=4)\n",
    "wedge6 = Wedge([5, -5], R-12, 270, 360, ec='orange',\n",
    "               fc=r'white', linewidth=4)\n",
    "wedge7 = Wedge([2, 2], R-5, 0, 90, ec='orange', \n",
    "               fc=r'white', linewidth=4)\n",
    "wedge8 = Wedge([5, 5], R-12, 0, 90, ec='orange',\n",
    "               fc=r'white', linewidth=4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "6450c26f",
   "metadata": {},
   "outputs": [
    {
     "ename": "RuntimeError",
     "evalue": "Can not put single artist in more than one figure",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "Input \u001b[1;32mIn [11]\u001b[0m, in \u001b[0;36m<cell line: 5>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      4\u001b[0m ax\u001b[38;5;241m.\u001b[39mset_aspect(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mequal\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      5\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m a \u001b[38;5;129;01min\u001b[39;00m art_list:\n\u001b[1;32m----> 6\u001b[0m     \u001b[43max\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43madd_patch\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m      8\u001b[0m plt\u001b[38;5;241m.\u001b[39maxis(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124moff\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      9\u001b[0m font_set \u001b[38;5;241m=\u001b[39m FontProperties(fname\u001b[38;5;241m=\u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAlibaba-PuHuiTi-Medium.ttf\u001b[39m\u001b[38;5;124m\"\u001b[39m, size\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m12\u001b[39m) \u001b[38;5;66;03m##可以自由下载字体使用\u001b[39;00m\n",
      "File \u001b[1;32mC:\\veighna_studio\\lib\\site-packages\\matplotlib\\axes\\_base.py:2355\u001b[0m, in \u001b[0;36m_AxesBase.add_patch\u001b[1;34m(self, p)\u001b[0m\n\u001b[0;32m   2351\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m   2352\u001b[0m \u001b[38;5;124;03mAdd a `.Patch` to the Axes; return the patch.\u001b[39;00m\n\u001b[0;32m   2353\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m   2354\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_deprecate_noninstance(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124madd_patch\u001b[39m\u001b[38;5;124m'\u001b[39m, mpatches\u001b[38;5;241m.\u001b[39mPatch, p\u001b[38;5;241m=\u001b[39mp)\n\u001b[1;32m-> 2355\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_set_artist_props\u001b[49m\u001b[43m(\u001b[49m\u001b[43mp\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   2356\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m p\u001b[38;5;241m.\u001b[39mget_clip_path() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m   2357\u001b[0m     p\u001b[38;5;241m.\u001b[39mset_clip_path(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpatch)\n",
      "File \u001b[1;32mC:\\veighna_studio\\lib\\site-packages\\matplotlib\\axes\\_base.py:1101\u001b[0m, in \u001b[0;36m_AxesBase._set_artist_props\u001b[1;34m(self, a)\u001b[0m\n\u001b[0;32m   1099\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_set_artist_props\u001b[39m(\u001b[38;5;28mself\u001b[39m, a):\n\u001b[0;32m   1100\u001b[0m     \u001b[38;5;124;03m\"\"\"Set the boilerplate props for artists added to Axes.\"\"\"\u001b[39;00m\n\u001b[1;32m-> 1101\u001b[0m     \u001b[43ma\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_figure\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfigure\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1102\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m a\u001b[38;5;241m.\u001b[39mis_transform_set():\n\u001b[0;32m   1103\u001b[0m         a\u001b[38;5;241m.\u001b[39mset_transform(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtransData)\n",
      "File \u001b[1;32mC:\\veighna_studio\\lib\\site-packages\\matplotlib\\artist.py:740\u001b[0m, in \u001b[0;36mArtist.set_figure\u001b[1;34m(self, fig)\u001b[0m\n\u001b[0;32m    734\u001b[0m \u001b[38;5;66;03m# if we currently have a figure (the case of both `self.figure`\u001b[39;00m\n\u001b[0;32m    735\u001b[0m \u001b[38;5;66;03m# and *fig* being none is taken care of above) we then user is\u001b[39;00m\n\u001b[0;32m    736\u001b[0m \u001b[38;5;66;03m# trying to change the figure an artist is associated with which\u001b[39;00m\n\u001b[0;32m    737\u001b[0m \u001b[38;5;66;03m# is not allowed for the same reason as adding the same instance\u001b[39;00m\n\u001b[0;32m    738\u001b[0m \u001b[38;5;66;03m# to more than one Axes\u001b[39;00m\n\u001b[0;32m    739\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfigure \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m--> 740\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCan not put single artist in \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    741\u001b[0m                        \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmore than one figure\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m    742\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfigure \u001b[38;5;241m=\u001b[39m fig\n\u001b[0;32m    743\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfigure \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfigure \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m:\n",
      "\u001b[1;31mRuntimeError\u001b[0m: Can not put single artist in more than one figure"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHWCAYAAACv91olAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAARb0lEQVR4nO3cX4jld3nH8c9jYir1b2lWkGxiUrpWFy1oh9QiVIu2JLnYXLSVBMQqwQXbSKkipFhU4pWVWhDS6paKVdAYvZAFV1KwkYAYyYo1mEhkG63ZKCT+y41oTPv0Yo5lHHczJ5sz8zAnrxcMnN853znn4csw7/2dOfur7g4AsLeeMj0AADwZCTAADBBgABggwAAwQIABYIAAA8CAHQNcVR+uqger6utnebyq6gNVd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7r7yNjQ+8SSe8s5WHJvb03yJ1V1T5L/SfL27vau2A6W3Nu3JfmXqvqbbH4g6w1OeHZWVZ/I5j8KL1z8/fxdSZ6aJN39wWz+Pf2qJKeS/CTJG5d6XnsPAHvPlbAAYIAAA8AAAQaAAQIMAAMEGAAGCDAADBBgABggwAAw4P8AEEaQH1ohYngAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 576x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "art_list = [arc1, arc2, arc3, arc4, arc5, arc6, arc7, arc8, arc9, arc10, arc11, arc12]\n",
    "art_list.extend([circle, wedge1, wedge2, wedge3, wedge4, wedge5, wedge6, wedge7, wedge8])\n",
    "fig, ax = plt.subplots(figsize=(8,8))\n",
    "ax.set_aspect('equal')\n",
    "for a in art_list:\n",
    "    ax.add_patch(a)\n",
    "    \n",
    "plt.axis('off')\n",
    "font_set = FontProperties(fname=r\"Alibaba-PuHuiTi-Medium.ttf\", size=12) ##可以自由下载字体使用\n",
    "plt.text(-15, -2.5, 'TianChi', bbox=dict(boxstyle='square', fc=\"w\", ec='orange', linewidth=4),  fontsize=50, color='orange') ##ec为线条颜色，color为字体颜色,可以自由替换\n",
    "plt.text(-28, -33, 'Python画月饼，千里共禅娟',fontproperties=font_set, fontsize=30, color='#aa4a30')\n",
    "plt.ylim([-35, 35])\n",
    "plt.xlim([-35, 35])\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "e5528e68",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting http://tianchi-media.oss-cn-beijing.aliyuncs.com/DSW/Python/miniproject/01_draw_moon_cake/Alibaba-PuHuiTi-Medium.ttf\n",
      "  Downloading http://tianchi-media.oss-cn-beijing.aliyuncs.com/DSW/Python/miniproject/01_draw_moon_cake/Alibaba-PuHuiTi-Medium.ttf (9.6 MB)\n",
      "     ---------------------------------------- 9.6/9.6 MB 14.2 MB/s eta 0:00:00\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  ERROR: Cannot unpack file C:\\Users\\ldq\\AppData\\Local\\Temp\\pip-unpack-qbjd2c8s\\Alibaba-PuHuiTi-Medium.ttf (downloaded from C:\\Users\\ldq\\AppData\\Local\\Temp\\pip-req-build-miu683py, content-type: font/ttf); cannot detect archive format\n",
      "ERROR: Cannot determine archive format of C:\\Users\\ldq\\AppData\\Local\\Temp\\pip-req-build-miu683py\n"
     ]
    }
   ],
   "source": [
    "!pip install http://tianchi-media.oss-cn-beijing.aliyuncs.com/DSW/Python/miniproject/01_draw_moon_cake/Alibaba-PuHuiTi-Medium.ttf\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "604f3c34",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
